<template>
  <m-menu
    :collapse="collapse"
    :data="data"
    router
    :defaultActive="$route.path"
  ></m-menu>
</template>

<script setup>
// 接收父组件传递的 props
const props = defineProps({
  collapse: Boolean,
})

// 数据数组
const data = [
  {
    icon: 'HomeFilled',
    name: '首页',
    index: '/',
  },
  {
    icon: 'Check',
    name: '图标选择器',
    index: '/chooseIcon',
  },
  {
    icon: 'Location',
    name: '省市区选择',
    index: '/chooseArea',
  },
  {
    icon: 'Sort',
    name: '趋势标记',
    index: '/trend',
  },
  {
    icon: 'Timer',
    name: '时间选择',
    index: '/chooseTime',
  },
  {
    icon: 'Bell',
    name: '通知菜单',
    index: '/notification',
  },
  {
    icon: 'Menu',
    name: '导航菜单',
    index: '/menu',
  },
  {
    icon: 'TurnOff',
    name: '城市选择',
    index: '/chooseCity',
  },
  {
    icon: 'DArrowRight',
    name: '进度条',
    index: '/progress',
  },
  {
    icon: 'ScaleToOriginal',
    name: '日历',
    index: '/calendar',
  },
  {
    icon: 'Setting',
    name: '表单',
    index: '/form',
  },
  {
    icon: 'Setting',
    name: '弹出框表单',
    index: '/modalForm',
  },
  {
    icon: 'ShoppingBag',
    name: '表格',
    index: '/table',
  },
  {
    icon: 'PieChart',
    name: 'echarts 图表',
    index: '/echarts',
  },
  {
    icon: 'AddLocation',
    name: '地图',
    index: '/map/AMap',
    children: [
      {
        icon: 'AddLocation',
        name: '高德',
        index: '/map/AMap',
      },
      {
        icon: 'AddLocation',
        name: '腾讯',
        index: '/map/TMap',
      },
      {
        icon: 'AddLocation',
        name: '百度',
        index: '/map/BMap',
      },
    ],
  },
  {
    icon: 'VideoCameraFilled',
    name: '视频播放',
    index: '/video/dahuatech',
    children: [
      {
        icon: 'VideoCameraFilled',
        name: '大华',
        index: '/video/dahuatech',
      },
      {
        icon: 'VideoCameraFilled',
        name: '海康',
        index: '/video/hikvision',
      },
    ],
  },
]
</script>

<style lang="scss" scoped></style>
